package com.xiaohudie.SGGJUC;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Author xiao hu die
 * @Date 2022/3/7 23:54
 * @Version 1.0
 */
public class TestHashMap {
 public static void main(String[] args) {
  Map<String, Object> objectObjectHashMap = new ConcurrentHashMap<>();
  for (int i = 0; i <20 ; i++) {
   new Thread(() -> {
    objectObjectHashMap.put(Thread.currentThread().getName(), UUID.randomUUID().toString().substring(0, 5));
    System.out.println(objectObjectHashMap);
   },String.valueOf(i)).start();
  }
 }
}
